package com.yuan.mint.fragment;


import android.content.Intent;
import android.view.View;
import android.widget.AdapterView;

import com.yuan.mint.R;
import com.yuan.mint.activity.RecommendDetailActivity;

public class NearbyFragment extends RecommendFragment implements AdapterView.OnItemClickListener {

    private static final int NEARBY_NEWEST = 0;
    private static final int NEARBY_SELECTED = 1;
    private static final int NEARBY_HOTSPOT = 2;

    public static String NEWEST_NAME = "newest";
    public static String SELECTED_NAME = "selected";
    public static String HOTSPOT_NAME = "hotspot";

    @Override
    protected void setListData() {
        reStr = new String[]{"最新", "精选", "今日热点"};
        images = new int[]{R.mipmap.ic_launcher,
                R.mipmap.ic_launcher, R.mipmap.ic_launcher};
    }

    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        switch (position) {
            case NEARBY_NEWEST:
                startActivity(new Intent(getActivity(), RecommendDetailActivity.class).putExtra("name", NEWEST_NAME));
                break;
            case NEARBY_SELECTED:
                startActivity(new Intent(getActivity(), RecommendDetailActivity.class).putExtra("name", SELECTED_NAME));
                break;
            case NEARBY_HOTSPOT:
                startActivity(new Intent(getActivity(), RecommendDetailActivity.class).putExtra("name", HOTSPOT_NAME));
                break;
        }
    }
}
